﻿
@{
    ViewData["Title"] = "Index";
    Layout = "~/Areas/User/Views/_UserLayout.cshtml";
}
<!-- APP MAIN ==========-->
<main id="app-main" class="app-main">
    <div class="wrap">
        <section class="app-content">
            <div class="widget">
                <header class="widget-header title1">
                    <h4 class="widget-title">服务中心申请</h4>
                </header><!-- .widget-header -->
                <hr class="widget-separator">
                <div class="widget-body">
                    <form id="form1" class="form-horizontal">
                        <div class="form-group">
                            <label for="#" class="col-sm-2 control-label">服务中心级别</label>
                            <div class="col-sm-5">
                                <select id="select" name="Level" class="form-control">
                                    <option value="1" selected="selected">一级服务中心</option>
                                    <option value="2">二级服务中心</option>
                                </select>
                            </div>
                        </div><!-- .form-group -->

                        <div class="form-group">
                            <label for="#" class="col-sm-2 control-label">服务中心名称</label>
                            <div class="col-sm-5">
                                <input class="form-control" name="Name" required placeholder="请填写服务中心名称">
                            </div>
                        </div><!-- .form-group -->

                        <div class="form-group">
                            <label for="#" class="col-sm-2 control-label">服务中心地址</label>
                            <div class="col-sm-5">
                                <input class="form-control" name="Address" required placeholder="请填写服务中心地址">
                            </div>
                        </div><!-- .form-group -->

                        <div class="form-group">
                            <label for="#" class="col-sm-2 control-label">二级密码</label>
                            <div class="col-sm-5">
                                <input class="form-control" name="SecondPassWord" type="password" required placeholder="请填写二级密码">
                            </div>
                        </div><!-- .form-group -->

                        <div class="form-group">
                            <div class="col-sm-7 text-center">
                                @Html.AntiForgeryToken()
                                <button type="submit" id="btn" class="btn btn-info">提交申请</button>
                            </div>
                        </div>
                    </form>
                </div><!-- .widget-body -->
            </div><!-- .widget -->
        </section><!-- #dash-content -->
    </div><!-- .wrap -->
    <!-- APP FOOTER -->
    <div class="wrap p-t-0">
        <footer class="app-footer">
            <div class="clearfix">
                <div class="copyright text-center w100">@OpenMms.Common.Url.NameConfig.companyName &copy;</div>
            </div>
        </footer>
    </div>
    <!-- /#app-footer -->
</main>
<!--========== END app main -->
<script type="text/javascript">
    $('#form1').on('submit', function(){
        layer.confirm('确定申请服务中心吗？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            formPost();
        }, function () {
            layer.close();
        });
        event.preventDefault() //阻止form表单默认提交
    })
    function formPost() {
        //加载层
        var index = layer.load(1, {
            shade: [0.1, '#fff']
        });
        $.ajax({
            type: "post",
            url: "/User/ServiceCenter/CenterApply",
            data: $('#form1').serialize(),
        }).success(function (message) {
            if (message.code != 200) {
                layer.msg(message.message, { icon: 2 });
            }
            else {
                layer.msg(message.message, {icon:1});
            }
        }).fail(function (err) {
            layer.msg('系统错误,请稍后重试!', { icon: 2 });
        })
        layer.close(index)//关闭加载层
    }

</script>


